import validation from './validation'

export const validateRequiredTrim = (_rule: any, value: any, callback: Fn, errorMsg: string) => {
  if (!validation.required(value)) {
    return callback(new Error(errorMsg))
  }
  callback()
}

export const validateMobile = (_rule: any, value: any, callback: Fn, errorMsg = '请输入正确的手机号码') => {
  if (!validation.isMobile(value)) {
    return callback(new Error(errorMsg))
  }
  callback()
}
